<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{{option_a}} vs {{option_b}}!</title>
    <base href="/index.html">
    <meta name="viewport" content="width=device-width, initial-scale = 1.0">
    <meta name="keywords" content="docker-compose, docker, stack">
    <meta name="author" content="Tutum dev team">
    <link rel='stylesheet' href="{{ url_for('static',filename='stylesheets/style.css') }}"/>
    <link rel="stylesheet" href="{{ url_for('static',filename='font-awesome/css/font-awesome.css') }}">
    <script>(function (i, s, o, g, r, beanOne, m) {
        i["DaoVoiceObject"] = r;
        i[r] = i[r] || function () {
                (i[r].q = i[r].q || []).push(arguments)
            }, i[r].l = 1 * new Date();
        beanOne = s.createElement(o), m = s.getElementsByTagName(o)[0];
        beanOne.async = 1;
        beanOne.src = g;
        m.parentNode.insertBefore(beanOne, m)
    })(window, document, "script", "//widget.daovoice.io/widget/23f3431a.js", "daovoice");</script>
</head>
<body>
<div id="content-container">
    <div id="content-container-center">
        <h3>{{option_a}} vs {{option_b}}!</h3>
        <form id="choice" name='form' method="POST" action="/">
            <button id="beanOne" type="submit" name="vote" class="beanOne" value="beanOne">{{option_a}}</button>
            <button id="beanTwo" type="submit" name="vote" class="beanTwo" value="beanTwo">{{option_b}}</button>
        </form>
        <div id="tip">
            (Tip: you can change your vote)
        </div>
        <div id="hostname">
            Vote processed by {{hostname}}
        </div>
    </div>
</div>
<script src="{{ url_for('static',filename='jquery.min.js') }}" type="text/javascript"></script>
<script src="{{ url_for('static',filename='jquery.cookie.min.js') }}"></script>
<script src="{{ url_for('static',filename='faker.js') }}"></script>

<script>
    var vote = "{{vote}}";

    if (vote == "beanOne") {
        $(".beanOne").prop('disabled', true);
        $(".beanOne").html('{{option_a}} <i class="fa fa-check-circle"></i>');
        $(".beanTwo").css('opacity', '0.5');
    }
    if (vote == "beanTwo") {
        $(".beanTwo").prop('disabled', true);
        $(".beanTwo").html('{{option_b}} <i class="fa fa-check-circle"></i>');
        $(".beanOne").css('opacity', '0.5');
    }
</script>

<script type="text/javascript">
    daovoice('init', {
        app_id: "23f3431a",
        user_id: faker.random.uuid(), // 必填: 该用户在您系统上的唯一ID
        email: faker.internet.email(), // 选填:  该用户在您系统上的主邮箱
        name: faker.name.findName(), // 选填: 用户名
    });

    daovoice('update');

</script>


</body>
</html>
